/*
 * NetworkCommandProducer.h
 *
 *  Created on: 2009-08-16
 *      Author: paul
 */

#ifndef NETWORKCOMMANDPRODUCER_H_
#define NETWORKCOMMANDPRODUCER_H_

#include "CommandActions.h"
#include "Command.h"
#include "Subject.h"

class NetworkCommandProducer : public CommandActions, public Subject
{
public:
	NetworkCommandProducer();
	virtual ~NetworkCommandProducer();

    virtual void update(Command &command);


    /// Perform the shift left.
    virtual void shiftLeft();

    /// Perform the shift right.
    virtual void shiftRight();

    /// Perform the soft down shift.
    virtual void softDown();

    /// Perform the hard down action.
    virtual void hardDown();

    /// Perform the gravity down action.
    virtual void gravityDown();

    /// Perform the gravity down action.
    virtual void shiftUp();

    /// Perform the counter-clockwise rotation of the active mino.
    virtual void rotateCCW();

    /// Perform the clockwise rotation of the active mino.
    virtual void rotateCW();


    /// Perform the set mino action.
    virtual void setMino();

    /// Perform the new mino action.
    /// @param minoNum 0-6 represents I, J, L, O, S, T, Z.
    virtual void newMino(int minoNum);

    /**
    * Clear the indicated rows in the well.
    * @param rows  An array of the rows to clear.
    * @param numRows   The number of elements in the array. Must not be bigger
    * than 4.
    */
    virtual void clearRows(const int rows[], int numRows);

    /**
    * Performs the the initialize game action, specifying the desired
    * width, height, hidden height, starting row and column of the origin
    * brick of the minos when they get introduced to the well, and starting
    * speed.
    * @param width The width of the well. Must be greater than or equal to 4.
    * @param totalHeight The height of the well. Must be greater or equal to 4.
    * @param hiddenHeight  The portion of the well that is hidden. Must be
    * greater or equal to 0, and cannot be equal to the total height of the
    * well.
    * @param startRow  The starting row of the origin brick of each new mino.
    *  Must be located within the confines of the well, and at least one row
    *  down from the top of the well, and two rows up from the bottom.
    *  Remember, row numbers go from 1 at the bottom to n at the top, so you
    *  would want it at n - 1, most likely.
    * @param startCol  The starting column of the origin brick of each new
    * mino. Must be at least one column in from the left, and two columns in
    * from the right. Column numbers for from 1 at the left to n at the right.
    * @param startSpeed    The starting speed of the mino decent. Must be
    * between 0-20.
    */
    virtual void initGame(int width, int totalHeight, int hiddenHeight,
            int startRow, int startCol, int startSpeed);

};

#endif /* NETWORKCOMMANDPRODUCER_H_ */
